package learn.spring;

import java.util.concurrent.TimeUnit;

/**
 * 线程睡眠
 * 
 * @author PinWei Wan
 * @since 2.6.9
 */
public class Nap {
    /**
     * 
     * @param t 毫秒
     */
    public Nap(long t) {
        try {
            TimeUnit.MILLISECONDS.sleep(t);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public Nap(long t, String msg) {
        this(t);
        System.out.println(msg);
    }
}
